
#include "PinholeCamera.h"

namespace CameraCalN
{
	using namespace RavlN;

	istream& operator>>(istream& s, PinholeCameraC& camera)
	{
		s >> camera.fx() >> camera.fy() >> camera.cx() >> camera.cy();
		s >> camera.R();
		s >> camera.t();
		return s;
	}

	ostream& operator<<(ostream& s, const PinholeCameraC& camera)
	{
		s << camera.fx() 
			<< " " << camera.fy() 
			<< " " << camera.cx() 
			<< " " << camera.cy() 
			<< endl;
		s << camera.R();
		s << camera.t();
		return s;
	}

	BinIStreamC& operator>>(BinIStreamC& s, PinholeCameraC& camera)
	{
		s >> camera.fx() >> camera.fy() >> camera.cx() >> camera.cy();
		s >> camera.R();
		s >> camera.t();
		return s;
	}

	BinOStreamC& operator<<(BinOStreamC& s, const PinholeCameraC& camera)
	{
		s << camera.fx() 
			<< camera.fy() 
			<< camera.cx() 
			<< camera.cy();
		s << camera.R();
		s << camera.t();
		return s;
	}
};
